# -*- coding : utf-8 -*-

def index():
    if request.vars.keys() == all_keys_list['alisoft']:
        session.vars = dict(request.vars)
        vars = session.vars
        vars['appId'] = vars.pop('app_id')
        vars['userId'] = vars.pop('user_id')
        vars['appInstanceId'] = vars.pop('app_instance_id')
        del vars['target']
        session.sip_dict = taobao_api.sip_dict_all(vars)
        redirect(URL(r=request, c='info', vars=session.vars))
    else:
        message = 'no'
        other = 'other'

    response.menu = [
        ['首页', False,URL(r=request, a='welcome', c='default', f='index')],
        ['淘宝易', True,URL(r=request, f='index')],
        ]
    response.title = '淘宝易'

    return dict(
        message = message,
        other = other
        )

def quit():
    session.token = False
    redirect(URL(r=request, f='index'))

def fast_login():
    session.token = True
    redirect(URL(r=request, f='index'))

def login():
    session.token = True
    redirect(URL(r=request, f='index'))